package com.senjoeson.teamfriends.utils;

import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;

/**
 * Created by senjoeson on 2018/5/14.
 */

public class DialogUtils {

    public static Dialog getAlertDialog(Context context, String title, String content) {

        AlertDialog.Builder alertDialog = new AlertDialog.Builder(context);
        alertDialog.setTitle(title);
        alertDialog.setMessage(content);
        alertDialog.setCancelable(false);
        alertDialog.setPositiveButton("朕知道了", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
                ALog.d("应该跳转到指定页面");
            }
        });
        //设置反面按钮
        alertDialog.setNegativeButton("别再打扰我了", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
                ALog.d("");
                dialog.dismiss();
            }
        });
        AlertDialog alertDialog1 = alertDialog.create();
        alertDialog1.setCanceledOnTouchOutside(true);
        alertDialog1.show();

        return alertDialog1;
    }
}
